/*
 RLRecyclingRun.h
 Date Created: February 18, 2010
 
 Author: Karol Krizka <kkrizka@gmail.com>
 
 Copyright (C) 2010 Green-Power
 
 URL: http://code.google.com/p/green-power
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 3 of the License, or
 (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
 $Id$
 */

#import <CoreData/CoreData.h>

#import "RLRecyclableItem.h"

@class RLRecyclingLog;

@interface RLRecyclingRun :  NSManagedObject  
{
}

@property (nonatomic, retain) NSDate * dateTime;
@property (nonatomic, retain) RLRecyclingLog * owner;
@property (nonatomic, retain) NSSet* items;

/**
 * Calculate the money earned during this run.
 *
 * \return Total number of cents earned this run.
 */
- (NSUInteger)moneyEarned;

/**
 * Fetch the item for represented by unique name. Always returns a valid object,
 * even if it was not stored in the recycling log. If it was not stored, it
 * creates a new one and adds it to the object context.
 *
 * \param uniqueName The unique name of the recyclable type
 *
 * \return The recyclable item
 */
- (RLRecyclableItem *)itemForUniqueName:(NSString *)uniqueName;

@end


@interface RLRecyclingRun (CoreDataGeneratedAccessors)
- (void)addItemsObject:(NSManagedObject *)value;
- (void)removeItemsObject:(NSManagedObject *)value;
- (void)addItems:(NSSet *)value;
- (void)removeItems:(NSSet *)value;

@end

